package com.bookmngsys.service;

import com.bookmngsys.entity.Book;
import com.bookmngsys.entity.BookLocation;
import com.bookmngsys.entity.BorrowBook;
import com.bookmngsys.entity.Category;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * @author han
 */
public interface BookService {
    List<Book> getBooks(int curPage, int pageSize, boolean isAdmin);

    List<Book> searchByBookName(String bookName);

    int getNumOfOverdue(int readerId);

    List<Book> searchByAuthor(String author);

    public List<Book> searchByIsbn(String isbn);

    Book getBook(String isbn);

    void borrowBook(int bookId, int readerId) throws Exception;

    List<BorrowBook> getBorrowBooks(int readerId);


    List<BorrowBook> getBorrowBooksByIsbn(String isbn);

    public void returnBook(int bookId) throws Exception;
    void payMoney(int bookId, String outTradeNo) throws Exception;

    void disableBook(String isbn);

    void enableBook(String isbn);

    List<Category> getCategory();

    void addBook(Book book);

    void updateBook(String originBook, Book book, HttpSession httpsession) throws Exception;

    void updateImg(String isbn,String Url);

    void borrowBookByReserve(String isbn, int readerId) throws Exception;

    public void renew(String isbn, int readerId) throws Exception;

    void deleteBookByIsbn(String isbn) throws Exception;

    void deleteBookByBookId(int bookid) throws Exception;

    void addCategory(String category);

    void deleteCategory(int id) throws Exception;

    List<BookLocation> getBookLocation();

    void addBookLocation(BookLocation bookLocation) throws Exception;

    void deleteBookLocation(String rackNumber) throws Exception;


}
